package com.xtianzhuang.www.service;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import com.xtianzhuang.www.entity.TdPermission;
import com.xtianzhuang.www.entity.TdPermissionExample;
import com.xtianzhuang.www.entity.TdRole;
import com.xtianzhuang.www.entity.TdRoleExample;
import com.xtianzhuang.www.entity.TfLoginLog;
import com.xtianzhuang.www.entity.TfUDetail;
import com.xtianzhuang.www.entity.TfUUser;
import com.xtianzhuang.www.entity.TfUUserExample;
import com.xtianzhuang.www.entity.TfUserDailyRecord;
import com.xtianzhuang.www.entity.TfWorkRecord;
import com.xtianzhuang.www.entity.VRolePermission;
import com.xtianzhuang.www.entity.VRolePermissionExample;
import com.xtianzhuang.www.entity.VUser;
import com.xtianzhuang.www.entity.VUserBudget;
import com.xtianzhuang.www.entity.VUserBudgetExample;
import com.xtianzhuang.www.entity.VUserDailySummary;
import com.xtianzhuang.www.entity.VUserDailySummaryExample;
import com.xtianzhuang.www.entity.VUserExample;
import com.xtianzhuang.www.entity.VUserRole;
import com.xtianzhuang.www.entity.VUserRoleExample;
import com.xtianzhuang.www.entity.VUserStory;
import com.xtianzhuang.www.entity.VUserStoryExample;
import com.xtianzhuang.www.entity.VUserTarget;
import com.xtianzhuang.www.entity.VUserTargetExample;
import com.xtianzhuang.www.entity.request.DeleteStoryBudgetRequest;
import com.xtianzhuang.www.entity.request.DeleteSummaryRequest;
import com.xtianzhuang.www.entity.request.DeleteTargetRequest;
import com.xtianzhuang.www.entity.request.LoginRequest;
import com.xtianzhuang.www.entity.request.QueryDailyLifeRequest;
import com.xtianzhuang.www.entity.request.QueryDailyWorkRequest;
import com.xtianzhuang.www.entity.request.SaveBudgetRequest;
import com.xtianzhuang.www.entity.request.SaveRoleRequest;
import com.xtianzhuang.www.entity.request.SaveStoryRequest;
import com.xtianzhuang.www.entity.request.SaveSummaryRequest;
import com.xtianzhuang.www.entity.request.SaveTargetRequest;
import com.xtianzhuang.www.entity.request.SaveUserRequest;
import com.xtianzhuang.www.entity.request.SaveWorkRequest;
import com.xtianzhuang.www.entity.request.UpdatePasswordRequest;
import com.xtianzhuang.www.entity.request.UpdateRolePermissionRequest;
import com.xtianzhuang.www.entity.request.UpdateTargetRequest;
import com.xtianzhuang.www.entity.request.UpdateUserRequest;
import com.xtianzhuang.www.entity.request.UpdateUserRoleRequest;
import com.xtianzhuang.www.entity.response.UpdateTargetResponse;

public interface UserService {

	void checkLogin(LoginRequest request) throws Exception;

	List<TfUUser> selectByExample(TfUUserExample example);

	TfUUser selectUserByUserName(String userName);

	List<TfUUser> getDeveloperUser();

	int insert(TfUUser record);

	void doUserLogin(HttpServletRequest request, LoginRequest loginRequest) throws Exception;

	int insertList(List<TfUUser> recordList);

	TfLoginLog getLastloginInfo(Integer userId);

	List<VUserRole> getUserRole(Integer userId);

	boolean checkWorkRequest(SaveWorkRequest request) throws Exception;

	void saveWork(SaveWorkRequest request) throws Exception;

	List<TfUserDailyRecord> queryDailyLife(QueryDailyLifeRequest request);

	long queryDailyLifeCount(QueryDailyLifeRequest request);

	List<TfWorkRecord> queryDailyWork(QueryDailyWorkRequest request);

	long queryDailyWorkCount(QueryDailyWorkRequest request);

	void saveUser(SaveUserRequest request) throws Exception;

	void updateUserPassword(UpdatePasswordRequest request) throws Exception;

	void updateUser(UpdateUserRequest request) throws Exception;

	void saveTarget(SaveTargetRequest request) throws Exception;

	void saveSummary(SaveSummaryRequest request) throws Exception;

	void saveStory(SaveStoryRequest request) throws Exception;

	void saveRole(SaveRoleRequest request) throws Exception;

	long userTargetCountQuery(VUserTargetExample example);

	List<VUserTarget> userTargetQuery(VUserTargetExample example);

	long userListCountQuery(VUserExample example);

	List<VUser> userListQuery(VUserExample example);

	long roleListCountQuery(TdRoleExample example);


	long userStoryCountQuery(VUserStoryExample example);

	List<VUserStory> userStoryQuery(VUserStoryExample example);

	UpdateTargetResponse updateTarget(UpdateTargetRequest request);

	void deleteTarget(DeleteTargetRequest request);

	void deleteSummary(DeleteSummaryRequest request);

	TfUDetail selectByUserId(Integer userId);

	/**
	 * 查询提醒生日的用户
	 * @return
	 */
	String selectBirthDayRemindUser() throws Exception;

	long userSummaryCountQuery(VUserDailySummaryExample example);

	List<VUserDailySummary> userSummaryQuery(VUserDailySummaryExample example);

	List<TdRole> roleListQuery(TdRoleExample example);

	List<TdPermission> permissionListQuery(TdPermissionExample example);

	List<VUserRole> userRoleListQuery(VUserRoleExample example);

	List<VRolePermission> rolePermissionListQuery(VRolePermissionExample example);

	public void updateUserRole(UpdateUserRoleRequest request);

	public void updateRolePermission(UpdateRolePermissionRequest request);

	long storyBudgetListCountQuery(VUserBudgetExample example);

	List<VUserBudget> storyBudgetListQuery(VUserBudgetExample example);

	void addStoryBudget(SaveBudgetRequest request) throws Exception;

	void updateStoryBudget(SaveBudgetRequest request) throws Exception;

	void deleteStoryBudget(DeleteStoryBudgetRequest request) throws Exception;

}
